<template>
<svg class="svg-icon" aria-hidden="true" :class="iconClass">
  <use :xlink:href="iconName"></use>
</svg>
</template>

<script>
export default {
  name: "icon-svg",
  props: {
    iconClass: {
      type: String,
      required: true,
    },
  },
  computed: {
    iconName() {
      return `#${this.iconClass}`;
    },
  },
};
</script>

<style>
.svg-icon {
  overflow: hidden;

  width: 1em;
  height: 1em;

  vertical-align: -0.15em;

  fill: currentColor;
}
</style>
